package com.cardone.platform.authority.service;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import com.cardone.common.dto.PaginationDto;
import com.cardone.context.ContextHolder;
import com.cardone.platform.authority.dao.UsGroupUserDao;
import com.cardone.platform.authority.dto.UsGroupUserDto;

/**
 * 用户组与用户服务
 *
 * @author yaohaitao
 *
 */
@Getter
@Setter
public class UsGroupUserDefaultService implements UsGroupUserService {
	@Override
	public int deleteByIds(final UsGroupUserDto deleteUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).deleteByIds(deleteUsGroupUser);
	}

	@Override
	public <P> P findByCodeOrId(final Class<P> mappedClass, final UsGroupUserDto findUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).findByCodeOrId(mappedClass, findUsGroupUser);
	}

	@Override
	public <P> P findById(final Class<P> mappedClass, final UsGroupUserDto findUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).findById(mappedClass, findUsGroupUser);
	}

	@Override
	public <P> List<P> findListByLikeCode(final Class<P> mappedClass, final UsGroupUserDto findListUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).findListByLikeCode(mappedClass, findListUsGroupUser);
	}

	@Override
	public int insertByCode(final UsGroupUserDto insertUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).insertByCode(insertUsGroupUser);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final UsGroupUserDto paginationUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).paginationByLikeCode(mappedClass, paginationUsGroupUser);
	}

	@Override
	public Integer readByCodeNqIdForCount(final UsGroupUserDto readUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).readByCodeNqIdForCount(readUsGroupUser);
	}

	@Override
	public <P> P saveByIdOrCode(final Class<P> mappedClass, final UsGroupUserDto saveUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).saveByIdOrCode(mappedClass, saveUsGroupUser);
	}

	@Override
	public int updateByCode(final UsGroupUserDto updateUsGroupUser) {
		return ContextHolder.getBean(UsGroupUserDao.class).updateByCode(updateUsGroupUser);
	}
}